﻿using DomainService.IService;
using DomainService.Service;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Model.BusinessModel;
using Model.BusinessModel.OutPut;
using Model.OverallAtuhModel;
using System.IdentityModel.Tokens.Jwt;
using Utility;
using Utility.Enum;

namespace ApprovalFlow_WebApi.Controllers
{
    /// <summary>
    /// 系统基础模块
    /// </summary>
    [ApiController]
    [Route("api/[controller]/[action]")]
    [ApiExplorerSettings(GroupName = nameof(ModeuleGroupEnum.DataSource))]
    [Authorize]
    public class DataSourceController : BaseController
    {
        #region 构造实列化

        /// <summary>
        /// 数据源服务
        /// </summary>
        public IDataSourceService _dataSourceService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataSourceService"></param>
        public DataSourceController(IDataSourceService dataSourceService)
        {
            _dataSourceService = dataSourceService;
        }

        #endregion

        /// <summary>
        /// 获取流程审批状态
        /// </summary>
        /// <returns></returns>
        public ReceiveStatus<List<SelectOutPut>> GetFlowApplyStateList()
        {
            ReceiveStatus<List<SelectOutPut>> receiveStatus = new();
            var result = _dataSourceService.GetFlowApplyStateList();
            receiveStatus.data = result;
            return receiveStatus;
        }
    }
}
